package com.wms.utils;

import com.wms.domain.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//全局异常处理器
@RestControllerAdvice
public class GlobalExceptionHandler {
    //指定捕获异常的类型 Exception.class 表示捕获所有异常
    @ExceptionHandler(Exception.class)
    public Result ex(Exception ex) {
        return Result.error("操作错误");
    }
}
